Skip to content

Prepare SCE maps and relevant FHiCLs for detector variation samples#795

Merged
nathanielerowe merged 14 commits intodevelopfrom
feature/lkashur_sce_detvar
Sep 16, 2025
Merged

Prepare SCE maps and relevant FHiCLs for detector variation samples#795
nathanielerowe merged 14 commits intodevelopfrom
feature/lkashur_sce_detvar

Conversation

@lkashur
Copy link
Copy Markdown
Collaborator

@lkashur lkashur commented Aug 21, 2025

Description

Three new space charge effect (SCE) maps are created with this PR:

  1. SCEoffsets_SBND_E500_dualmap_CV_voxelTH3.root (1.1x nominal in East TPC, 1.4x nominal in West TPC)
  2. SCEoffsets_SBND_E500_dualmap_0x_voxelTH3.root (bin contents in CV histogram are multiplied by zero)
  3. SCEoffsets_SBND_E500_dualmap_2x_voxelTH3.root (bin contents in CV histogram are multiplied by two)

Scaling of histograms is achieved with the following function:

TH3F* scale_TH3F(TH3F* source_hist, string out_name, double scaling)
{
  TH3F* out_hist = (TH3F*) source_hist->Clone();
  for(int i=1; i<=source_hist->GetNbinsX(); ++i){
    for(int j=1; j<=source_hist->GetNbinsY(); ++j){
      for(int k=1; k<=source_hist->GetNbinsZ(); ++k){
        Float_t orig = source_hist->GetBinContent(i, j, k);
        out_hist->SetBinContent(i,j,k, scaling*orig);
      }
    }
  }
  out_hist->SetName(out_name.c_str());
  return out_hist;
}

As usual, these maps are to be stored in the latest version of sbnd_data/SCEoffsets. For now, I have copied the latest version of sbnd_data to my working directory: /exp/sbnd/app/users/lkashur/sce_detvar/sbnd_data/.

Motivation for the scalings used for #1 (1.1x and 1.4x offsets) comes from differences seen in spatial offsets between TPCs using Spring 2025 crossing muon data:
sbnd_sce_dx_vs_x_nominal_sim

New FHiCL files for g4 simulation point to these maps and are located in JobConfigurations/standard/g4/sce_variations/:

  • g4_enable_nominalspacecharge_sbnd.fcl
  • g4_enable_zerospacecharge_sbnd.fcl
  • g4_enable_doublespacecharge_sbnd.fcl

Additionally, the standard LArSoft SCE FHiCL (LArSoftConfigurations/spacecharge_sbnd.fcl) now points to the updated CV map.

For validation, a small sample of anode-cathode crossing muons was created at the gen stage, and processed with each of the SCE variation maps at the g4 stage. Resultant simulated spatial offsets in the drift coordinate are shown here.

CV

sim_edeps_sce_detvar_cv

0x

sim_edeps_sce_detvar_0x

2x

sim_edeps_sce_detvar_2x

$${\color{red}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}$$

$${\color{red}\bf{\textrm{IMPORTANT UPDATE June 22nd 2025:}}}$$ If you are making a PR which is intended as a patch for the CURRENT production (which started in Spring 2025), you must make two PRs: one for develop and one for the production/v10_06_00 branch.

$${\color{red}!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!}$$

Checklist

  • Added at least 1 label from available labels.
  • Assigned at least 1 reviewer under Reviewers,
  • Assigned all contributers including yourself under Assignees
  • Linked any relevant issues under Developement
  • Does this PR affect CAF data format? If so, please assign a CAF maintainer (PetrilloAtWork or JosiePaton) as additional reviewer.
  • Does this affect the standard workflow?
  • Is this PR a patch for the ongoing production? If so, separate PR must also be made for production/v10_06_00 branch!

Relevant PR links (optional)

Does this PR require merging another PR in a different repository (such as sbnanobj/sbnobj etc.)?

Link(s) to docdb describing changes (optional)

Is there a docdb describing the issue this solves or the feature added?

@lkashur lkashur requested review from linyan-w and mrmooney August 21, 2025 22:05
@lkashur lkashur self-assigned this Aug 21, 2025
@lkashur lkashur added the simulation genie or geant4 (g4) label Aug 21, 2025
@lkashur lkashur marked this pull request as ready for review August 25, 2025 22:45
Copy link
Copy Markdown
Contributor

@linyan-w linyan-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!
This PR changes both default CV & adds detvars. The detvars are rockbox only, which for now is ok - likely we won't do intime detvars.
If we converge to overlay this obviously needs to change, but that's beyond the scope of this PR.

@linyan-w linyan-w self-requested a review August 28, 2025 02:04
Copy link
Copy Markdown
Contributor

@linyan-w linyan-w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to move the g4 detvars to detsim, like the production PR #797

@linyan-w linyan-w self-requested a review August 28, 2025 16:17
@lkashur
Copy link
Copy Markdown
Collaborator Author

lkashur commented Aug 29, 2025

@linyan-w I've created the detsim fhicls in standard/detsim/detector_variations/, and deleted the standard/g4/sce_variations directory.

Plus added the print out statement in SpaceCharge.cxx.

I think those were the only necessary changes?

@linyan-w linyan-w moved this from Todo to Approved in SBND 2025 Fall Production Sep 4, 2025
@nathanielerowe
Copy link
Copy Markdown
Contributor

trigger build ci_ref=v10_09_00 LArSoft/lar*@LARSOFT_SUITE_v10_09_00 SBNSoftware/sbncode@v10_09_00 SBNSoftware/sbnalg@v10_09_00 SBNSoftware/sbnobj@v10_01_02 SBNSoftware/sbnanaobj@v10_00_06 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbndata@v01_07 SBNSoftware/sbndutil@v10_06_00_02 SBNSoftware/sbnd_data@v01_35_00

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

❌ CI build for SBND Failed at phase ci_tests SBND on slf7 for e26:prof - ignored failure for unit_test - ignored warnings for build -- details available through the CI dashboard

🚨 For more details about the failed phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@nathanielerowe
Copy link
Copy Markdown
Contributor

trigger build ci_ref=v10_09_00 LArSoft/lar*@LARSOFT_SUITE_v10_09_00 SBNSoftware/sbncode@v10_09_00 SBNSoftware/sbnalg@v10_09_00 SBNSoftware/sbnobj@v10_01_02 SBNSoftware/sbnanaobj@v10_00_06 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbndata@v01_07 SBNSoftware/sbndutil@v10_06_01 SBNSoftware/sbnd_data@v01_35_00

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

⚠️ CI build for SBND Warning at phase ci_tests SBND on slf7 for e26:prof - ignored failure for unit_test -- details available through the CI dashboard

🚨 For more details about the warning phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@linyan-w linyan-w moved this from Approved to To be merged in SBND 2025 Fall Production Sep 10, 2025
@nathanielerowe
Copy link
Copy Markdown
Contributor

@lkashur It looks like there may have been an issue with a fcl file it couldn't find.

20: terminate called after throwing an instance of 'cet::exception'
21:   what():  ---- search_path BEGIN
22:   Can't find file "detsim_detvar.fcl"
23: ---- search_path END 

Any ideas where this is normally found? I don't immediately see it anywhere

@lkashur
Copy link
Copy Markdown
Collaborator Author

lkashur commented Sep 11, 2025

I've now added detsim_detvar.fcl, I think this was missing due to an oversight. It should now mirror the setup of the production branch for SCE variations

@lkashur
Copy link
Copy Markdown
Collaborator Author

lkashur commented Sep 11, 2025

trigger build ci_ref=v10_09_00 LArSoft/lar*@LARSOFT_SUITE_v10_09_00 SBNSoftware/sbncode@v10_09_00 SBNSoftware/sbnalg@v10_09_00 SBNSoftware/sbnobj@v10_01_02 SBNSoftware/sbnanaobj@v10_00_06 SBNSoftware/sbndaq-artdaq-core@v1_10_06 SBNSoftware/sbndata@v01_07 SBNSoftware/sbndutil@v10_06_01 SBNSoftware/sbnd_data@v01_35_00

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for c14:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

✔️ CI build for LArSoft Succeeded on slf7 for e26:prof -- details available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

❌ CI build for SBND Failed at phase build SBND on slf7 for c14:prof -- details available through the CI dashboard

🚨 For more details about the failed phase, check the build SBND phase logs

parent CI build details are available through the CI dashboard

@FNALbuild
Copy link
Copy Markdown
Collaborator

⚠️ CI build for SBND Warning at phase ci_tests SBND on slf7 for e26:prof -- details available through the CI dashboard

🚨 For more details about the warning phase, check the ci_tests SBND phase logs

parent CI build details are available through the CI dashboard

@nathanielerowe
Copy link
Copy Markdown
Contributor

Approved!

@nathanielerowe nathanielerowe moved this from To be merged to RM Approved in SBND 2025 Fall Production Sep 11, 2025
@nathanielerowe nathanielerowe merged commit 276b522 into develop Sep 16, 2025
@nathanielerowe nathanielerowe moved this from RM Approved to In tagged release in SBND 2025 Fall Production Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

simulation genie or geant4 (g4)

Projects

Status: In tagged release

Development

Successfully merging this pull request may close these issues.

5 participants